package Server.Dwc.fish;

import org.json.JSONObject;

import common.routine.JsonUtils;

public class CMD_Fish {

}

class IJsonExport {
	public String toString() {
		return getJsonData();
	}

	private String getJsonData() {
		return "";
	}

	public static String sprintf_BYTE(int by[][], int count) {

		int tmpCardData[] = new int[count]; // 用户扑克
		for (int i = 0; i < by.length; i++) {
			for (int k = 0; k < by[i].length; k++) {
				tmpCardData[i * by[i].length + k] = by[i][k];
			}
		}
		String strCardData = sprintf_BYTE(tmpCardData, count);
		return strCardData;
	}

	public static String sprintf_BYTE(Integer by[][], int count) {

		int tmpCardData[] = new int[count]; // 用户扑克
		for (int i = 0; i < by.length; i++) {
			for (int k = 0; k < by[i].length; k++) {
				tmpCardData[i * by[i].length + k] = by[i][k];
			}
		}
		String strCardData = sprintf_BYTE(tmpCardData, count);
		return strCardData;
	}

	public static String sprintf_BYTE(Integer by[], int count) {
		return sprintf_INT32(by, count);
	}

	public static String sprintf_BYTE(int by[], int count) {
		return sprintf_INT32(by, count);
	}

	public static String sprintf_DWORD(int dw[], int count) {
		return sprintf_INT32(dw, count);
	}

	public static String sprintf_INT32(Integer dw[], int count) {
		if (count < 1) {
			return "";
		}
		StringBuffer out_str = new StringBuffer();
		out_str.append(dw[0]);
		for (int i = 1; i < count; i++) {
			out_str.append(",");
			out_str.append(dw[i]);
		}
		return out_str.toString();
	}

	public static String sprintf_INT32(int dw[], int count) {
		if (count < 1) {
			return "";
		}
		StringBuffer out_str = new StringBuffer();
		out_str.append(dw[0]);
		for (int i = 1; i < count; i++) {
			out_str.append(",");
			out_str.append(dw[i]);
		}
		return out_str.toString();
	}
}
class FishUseItemResult{
	public int out_cntItem;
	public int out_costGem;
}
class FishConfig{
	public int m_iType;
	public int m_iOdds;
	public int m_iBlood;
	public int m_iSpeed;
	public int m_iBornLimit;
	public int m_iMaxLimit;
	public FishConfig(int type,int odds,int blood,int speed,int bornlimit,int maxlimit){
		m_iType = type;
		m_iOdds = odds;
		m_iBlood = blood;
		m_iSpeed = speed;
		m_iBornLimit = bornlimit;
		m_iMaxLimit = maxlimit;
	}
}
class FishInfo{
	public long m_tBirthTime;
	public int m_iFishID;
	public int m_iFishType;
	public int m_iPathId;
	public int m_iBlood;
	public int m_iStatus;
	public int m_iOdds;
	public int m_iEatCoin;
}

class tagSeatInfo{
	public int dwUserID;
	public int cannonLevel;
	public int isAndroidUser;
	public tagSeatInfo(){
		dwUserID = 0;
		cannonLevel = 0;
		isAndroidUser = 0;
	}
}

class MSG_AddFish{
	public long m_tBirthTime;
	public long m_tNowTime;
	public int[] m_iFishId;
	public int m_iFishType;
	public int m_iPathId;
	public int m_iNum;
	public int m_iDirection;
	public int m_iDeviation;
	public int m_iSpeed;
	public MSG_AddFish(){
		clean();
	}
	public void clean(){
		m_tBirthTime = 0;
		m_tNowTime = 0;
		m_iFishId = new int[10];
		m_iFishType = 0;
		m_iPathId = 0;
		m_iNum = 0;
		m_iDirection = 0;
		m_iDeviation = 0;
		m_iSpeed = 0;
	}
	public void copyFromAddFishCmd(SUBCMD_S_AddFish cmd){
		this.m_tBirthTime = cmd.m_tBirthTime;
		this.m_tNowTime = cmd.m_tNowTime;
		this.m_iFishId = cmd.m_iFishId;
		this.m_iFishType = cmd.m_iFishType;
		this.m_iPathId = cmd.m_iPathId;
		this.m_iNum = cmd.m_iNum;
		this.m_iDirection = cmd.m_iDirection;
		this.m_iDeviation = cmd.m_iDeviation;
		this.m_iSpeed = cmd.m_iSpeed;
	}
}

class MSG_AddYuChao{
	public int m_tBirthTime;
	public int m_tNowTime;
	public int m_iYuChaoType;
	public int m_iStartID;
	public MSG_AddYuChao(){
		clean();
	}
	public void clean(){
		m_tBirthTime = 0;
		m_tNowTime = 0;
		m_iYuChaoType = 0;
		m_iStartID = 0;
	}
}

////////////
class FishMsgBase{
	public String command;
	public String type;
	public String v;
	public FishMsgBase(){
		type = "";
		command = "fishmsg";
		v = "1";
	}
}
class FishSeatInfo extends FishMsgBase{
	public int m_lUid;
	public int m_iSeatId;
	public int m_iVipLevel;
	public int m_iCoin;
	public int m_iGem;
	public int m_iCannonAvatar;
	public int m_iCannonLevel;
	public int m_iMaxCannonLevel;
	public int m_iCannonCost;
	public String m_sNickName;
	public String toString(){
		return JsonUtils.serialize(this);
	}
}
class SUBCMD_S_Join extends FishMsgBase{
	public int m_lUid;
	public SUBCMD_S_Join(){
		type = "SUBCMD_S_Join";
	}
	public String toString(){
		return JsonUtils.serialize(this);
	}
}
class SUBCMD_S_JoinTable extends FishMsgBase{
	public int m_lUid;
	public int m_iRoomId;
	public int m_iBase;
	public FishSeatInfo[] m_seatInfo;
	public SUBCMD_S_JoinTable(){
		m_seatInfo = new FishSeatInfo[4];
		type = "SUBCMD_S_JoinTable";
	}
	public String toString(){
		return JsonUtils.serialize(this);
	}
}
class SUBCMD_S_Leave extends FishMsgBase{
	public int m_lUid;
	public SUBCMD_S_Leave(){
		type = "SUBCMD_S_Leave";		
	}
	public String toString(){
		return JsonUtils.serialize(this);
	}
}
class SUBCMD_S_LeaveTable extends FishMsgBase{
	public int m_lUid;
	public SUBCMD_S_LeaveTable(){
		type = "SUBCMD_S_LeaveTable";
	}
	public String toString(){
		return JsonUtils.serialize(this);
	}
}
class SUBCMD_S_RoomInfo extends FishMsgBase{
	public int m_iRoomId;
	public int m_iBase;
	public FishSeatInfo[] m_seatInfo;
	public SUBCMD_S_RoomInfo(){
		type = "SUBCMD_S_RoomInfo";
	}
	public String toString(){
		return JsonUtils.serialize(this);
	}
}
class SUBCMD_S_AddFish extends FishMsgBase{
	public long m_tBirthTime;
	public long m_tNowTime;
	public int[] m_iFishId;
	public int m_iFishType;
	public int m_iPathId;
	public int m_iNum;
	public int m_iDirection;
	public int m_iDeviation;
	public int m_iSpeed;
	public SUBCMD_S_AddFish(){
		m_iFishId = new int[10];
		type = "SUBCMD_S_AddFish";
	}
	public String toString(){
		return JsonUtils.serialize(this);
	}
}
class SUBCMD_S_AddYuChao extends FishMsgBase{
	public long m_tBirthTime;
	public long m_tNowTime;
	public int m_iYuChaoType;
	public int m_iStartID;
	public SUBCMD_S_AddYuChao(){
		type = "SUBCMD_S_AddYuChao";
	}
	public String toString(){
		return JsonUtils.serialize(this);
	}
}
//fire
class SUBCMD_S_DoFire extends FishMsgBase{
	public int m_lUid;
	public int m_lTotalCoin;
	public int m_iSeat;
	public int m_iCannonLevel;
	public int m_rotation;
	public SUBCMD_S_DoFire(){
		type = "SUBCMD_S_DoFire";
	}
	public String toString(){
		return JsonUtils.serialize(this);
	}
}
//adjust cannon
class SUBCMD_S_AdjustCannon extends FishMsgBase{
	public int m_lUid;
	public int m_iSeat;
	public int m_iCannonLevel;
	public int m_iCost;
	public SUBCMD_S_AdjustCannon(){
		type = "SUBCMD_S_AdjustCannon";
	}
	public String toString(){
		return JsonUtils.serialize(this);
	}
}
//update cannon
class SUBCMD_S_UpgradeCannon extends FishMsgBase{
	public int m_lUid;
	public int m_iSeat;
	public int m_iReault;
	public int m_iMaxCannonLevel;
	public int m_iCostGem;
	public int m_iAddCoin;
	public SUBCMD_S_UpgradeCannon(){
		type = "SUBCMD_S_UpgradeCannon";
	}
	public String toString(){
		return JsonUtils.serialize(this);
	}
}
class SUBCMD_S_UpgradeCannon1 extends FishMsgBase{
	public int m_lUid;
	public int m_iSeat;
	public int m_iResult;
	public int m_iMaxCannonLevel;
	public int m_iNeedCoin;
	public SUBCMD_S_UpgradeCannon1(){
		type = "SUBCMD_S_UpgradeCannon1";
	}
	public String toString(){
		return JsonUtils.serialize(this);
	}
}
//hit
class SUBCMD_S_Catch extends FishMsgBase{
	public int m_lUid;
	public int m_iSeat;
	public int m_xPoint;
	public int m_yPoint;
	public int m_iAddCoin;
	public int m_iAddGem;
	public int m_iTotalCoin;
	public int m_iTotalGem;
	public int m_iOdds;
	public int[] m_iFishId;
	public SUBCMD_S_Catch(){
		m_iFishId = new int[10];
		type = "SUBCMD_S_Catch";		
	}
	public String toString(){
		return JsonUtils.serialize(this);
	}
}
//get item
class SUBCMD_S_GiveItem extends FishMsgBase{
	public int m_lUid;
	public int m_iSeat;
	public int m_xPoint;
	public int m_yPoint;
	public int[] m_iGiveItem;
	public SUBCMD_S_GiveItem(){
		type = "SUBCMD_S_GiveItem";
	}
	public String toString(){
		return JsonUtils.serialize(this);
	}
	public static void addGiveItem(SUBCMD_S_GiveItem item,int item_id,int item_cnt){
		for(int i = 0;i < 8;i++){
			if(item.m_iGiveItem[2 * i] == 0){
				item.m_iGiveItem[2 * i] = item_id;
				item.m_iGiveItem[2 * i + 1] = item_cnt;
				break;
			}
		}
	}
}
//save life gold
class SUBCMD_S_AlmsCountDown extends FishMsgBase{
	public int m_lUid;
	public int m_iSeat;
	public long m_iCountDown;
	public SUBCMD_S_AlmsCountDown(){
		type = "SUBCMD_S_AlmsCountDown";
	}
	public String toString(){
		return JsonUtils.serialize(this);
	}
}
//who`s alms
class SUBCMD_S_Alms extends FishMsgBase{
	public int m_lUid;
	public int m_iSeat;
	public int m_iAlms;
	public SUBCMD_S_Alms(){
		type = "SUBCMD_S_Alms";
	}
	public String toString(){
		return JsonUtils.serialize(this);
	}
}
class SUBCMD_S_Chat extends FishMsgBase{
	public int m_lUid;
	public int m_iSeat;
	public int m_iType;
	public String m_sData;
	public SUBCMD_S_Chat(){
		type = "SUBMCD_S_Chat";
	}
	public String toString(){
		return JsonUtils.serialize(this);
	}
}
class SUBCMD_S_UseItem extends FishMsgBase{
	public int m_lUid;
	public int m_iSeat;
	public int m_iItemId;
	public int m_iTemUsed;
	public int m_iItemCount;
	public int m_iCostCoin;
	public int m_iCostGem;
	public int m_iTotalCoin;
	public int m_iTotalGem;
	public SUBCMD_S_UseItem(){
		type = "SUBCMD_S_UseItem";
	}
	public String toString(){
		return JsonUtils.serialize(this);
	}
}
class SUBCMD_S_Freeze extends FishMsgBase{
	public int m_lUid;
	public int m_iSeat;
	public int m_iRemainTime;
	public SUBCMD_S_Freeze(){
		type = "SUBCMD_S_Freeze";
	}
	public String toString(){
		return JsonUtils.serialize(this);
	}
}
class SUBCMD_S_Lamp extends FishMsgBase{
	public int m_lUid;
	public int m_iSeat;
	public int m_iFishType;
	public int m_iFishID;
	public SUBCMD_S_Lamp(){
		type = "SUBCMD_S_Lamp";
	}
	public String toString(){
		return JsonUtils.serialize(this);
	}
}
//lock
class SUBCMD_S_Lock extends FishMsgBase{
	public int m_lUid;
	public int m_iSeat;
	public int m_iRemainTime;
	public SUBCMD_S_Lock(){
		type = "SUBCMD_S_Lock";
	}
	public String toString(){
		return JsonUtils.serialize(this);
	}
}
//wild
class SUBCMD_S_Wild extends FishMsgBase{
	public int m_lUid;
	public int m_iSeat;
	public SUBCMD_S_Wild(){
		type = "SUBCMD_S_Wild";
	}
	public String toString(){
		return JsonUtils.serialize(this);
	}
}